package com.tien.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * @author Tien E-mail:g.tianxin@gmail.com
 * @version Time：2012-2-19 上午01:35:21
 */
@Entity
@Table(name = "MENUS")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)  
public class Menu implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2787610660378419372L;
	@Id
	@GeneratedValue
	private Long id;
	@Column(name="MENU_NAME")
	private String name;
	@Column(name="MENU_URL")
	private String url;
	@Column(name="PARENT_MENU_ID")
	private Long pId;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Long getpId() {
		return pId;
	}

	public void setpId(Long pId) {
		this.pId = pId;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "menu.id=" + id + " menu.name=" + name + " menu.url=" + url + " menu.parentId= " + this.pId;
	}

}
